home *** CD-ROM | disk | FTP | other *** search
- Path: news.internetMCI.com!news-admin
- From: "Michael P. Lascuola" <mlascuola@mcimail.com>
- Newsgroups: comp.lang.c++
- Subject: Help creating 32-bit .DLL
- Date: Tue, 12 Mar 1996 08:14:59 -0700
- Organization: InternetMCI
- Message-ID: <314594F3.DCC@mcimail.com>
- NNTP-Posting-Host: 166.37.9.79
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (Win95; I)
-
- Has anyone created a .DLL for Visual FoxPro 3.0? I've been having a
- devil of a time. I have created the .CPP program and created the .DLL
- using Borland 4.52, but Fox says "Cannot find entry point <function> in
- the DLL."
-
- Does anyone have any suggestions? THANKS!
-
- Here is the .CPP:
-
- //---------------------------------------------------------------------
- // Name: TEST.CPP
- // Description: Test of .DLL called by VFP
- //---------------------------------------------------------------------#include <string.h>
- #include <ctype.h>
- #include <windows.h>
- #include <stdio.h> // for sprintf
- #include <time.h> // for time_t
-
- HANDLE hInst;
- int WinDoc;
-
-
-
- /***********************************************************************
- LibMain() - Entry point to DLL. Registers windows classes.
- ************************************************************************/
- BOOL WINAPI DLLEntryPoint( HANDLE hDll, DWORD dwReason, LPVOID
- lpReserved )
- {
-
- hInst = hDll;
- //Placed here to see if entry point ever reached
- FILE *out=fopen("DLL.log","w");
- char tbuf[28];
- time_t t = time(NULL);
- strcpy(tbuf,ctime(&t));
- fprintf(out," Started Log %s",tbuf);
- fclose(out);
-
- return( TRUE );
- }
-
-
-
-
- //* WEP
-
- #if defined(__BORLANDC__) || defined(_MSC_VER)
- extern "C" int FAR PASCAL WEP
- #else
- extern "Pascal" int WEP
- #endif
- ( int )
- {
- return 1;
- }
-
-
-
-
-
- //---------------------------------------------------------------------//
- // Function Name: UseXLT
- //
- // Description: Test function
- //
- //---------------------------------------------------------------------
- char* FAR PASCAL _export UseXLT(char * str);
-
- char* FAR PASCAL _export UseXLT(char * str)
- {
- char *tempbuf;
- tempbuf = new char[256];
- sprintf(tempbuf, "%sNewValue", str);
- return (char *)tempbuf;
- }
-